<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>后台管理系统 -- 登录 -- R&R</title>
		<link href="../images/favicon1.ico" rel="Shortcut Icon"/>
		<link rel="Bookmark" href="../images/favicon1.ico"/>
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="this is my page">
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<link href="css/skin.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="../share/js/jquery-1.4.3.min.js"></script>
		<script type="text/javascript" src="../share/js/json2.js"></script>
		<script type="text/javascript">
		function correctPNG() {
			var arVersion = navigator.appVersion.split("MSIE")
			var version = parseFloat(arVersion[1])
			if ((version >= 5.5) && (document.body.filters)) {
				for ( var j = 0; j < document.images.length; j++) {
					var img = document.images[j]
					var imgName = img.src.toUpperCase()
					if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
						var imgID = (img.id) ? "id='" + img.id + "' " : ""
						var imgClass = (img.className) ? "class='" + img.className
								+ "' " : ""
						var imgTitle = (img.title) ? "title='" + img.title + "' "
								: "title='" + img.alt + "' "
						var imgStyle = "display:inline-block;" + img.style.cssText
						if (img.align == "left")
							imgStyle = "float:left;" + imgStyle
						if (img.align == "right")
							imgStyle = "float:right;" + imgStyle
						if (img.parentElement.href)
							imgStyle = "cursor:hand;" + imgStyle
						var strNewHTML = "<span "
								+ imgID
								+ imgClass
								+ imgTitle
								+ " style=\""
								+ "width:"
								+ img.width
								+ "px; height:"
								+ img.height
								+ "px;"
								+ imgStyle
								+ ";"
								+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
								+ "(src=\'" + img.src
								+ "\', sizingMethod='scale');\"></span>"
						img.outerHTML = strNewHTML
						j = j - 1
					}
				}
			}
		}
		window.attachEvent("onload", correctPNG);
		</script>
		<script type="text/javascript">
		function init() {
			$('#resultMsg').hide();
			$('#username').focus();
		}
		
		function reset() {
			$('#username').val('');
			$('#password').val('');
			$('#resultMsg').hide();
		}
		
		$("body").bind('keyup',function(event) {  
			if(event.keyCode==13){  
				login();  
			}
		});
		
		function login() {
			$('#Submit').attr('disabled',true);
			$("#resultMsg").hide();
			$.ajax({
				url:'admin/login.action',
				type:"POST",
				data: {adminJsonString:JSON.stringify({
					username:$('#username').val(),
					password:$('#password').val()
				})},
				dataType:"string",
				success:function(data){
					var resultJson = eval("(" + data + ")");
					if(resultJson.result == "success") {
						location.href = 'sendRedirect.action';
					} else if(resultJson.result == "fail") {
						$("#resultMsg").show();
						$("#resultMsgContent").html("<font color=red>用户名或密码错误，登录失败</font>");
						$('#Submit').attr('disabled',false);
					}
				}
			});
		}
        </script>
		<style type="text/css">
		body {
			margin-left: 0px;
			margin-top: 0px;
			margin-right: 0px;
			margin-bottom: 0px;
			background-image: url(images/login_bg.png);
			background-repeat: no-repeat;
			background-position: center;
		}
		.hideResultMsg {
			display: none;
		}
		</style>
		
	<title>网站管理员登陆</title>
	</head>
<body onload="init()">
	<table width="100%" height="166" border="0" cellpadding="0"
		cellspacing="0">
		<tr>
			<td height="42" valign="top">
				<table width="100%" height="42" border="0" cellpadding="0"
					cellspacing="0" class="login_top_bg">
					<tr>
						<td width="1%" height="21"></td>
						<td height="42"></td>
						<td width="17%"></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td valign="top">
				<table width="100%" height="532" border="0" cellpadding="0"
					cellspacing="0" class="login_bg">
					<tr>
						<td width="49%" align="right">
							<table width="91%" height="532" border="0" cellpadding="0"
								cellspacing="0" class="login_bg2">
								<tr>
									<td height="138" valign="top">
										<table width="89%" height="427" border="0" cellpadding="0"
											cellspacing="0">
											<tr>
												<td height="149"></td>
											</tr>
											<tr>
												<td height="80" align="right" valign="top"></td>
											</tr>
											<tr>
												<td height="198" align="right" valign="top">
													<table width="100%" border="0" cellpadding="0"
														cellspacing="0">
														<tr>
															<td width="35%"></td>
															<td height="25" colspan="2" class="left_txt"></td>
														</tr>
														<tr>
															<td></td>
															<td height="25" colspan="2" class="left_txt"></td>
														</tr>
														<tr>
															<td></td>
															<td height="25" colspan="2" class="left_txt"></td>
														</tr>
														<tr>
															<td></td>
															<td width="30%" height="40"></td>
															<td width="35%"></td>
														</tr>
													</table>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
						<td width="1%"></td>
						<td width="50%" valign="bottom">
							<table width="100%" height="59" border="0" align="center"
								cellpadding="0" cellspacing="0">
								<tr>
									<td width="0%"></td>
									<td width="100%" height="38">
										<span class="login_txt_bt">登陆信息网后台管理</span>
									</td>
								</tr>
								<tr>
									<td></td>
									<td height="21">
										<table cellSpacing="0" cellPadding="0" width="100%" border="0"
											id="table211" height="326">
											<tr>
												<td height="162" colspan="2" align="middle">
													<form name="myform" action="index.jsp" method="post">
														<table cellSpacing="0" cellPadding="0" width="100%"
															border="0" height="143" id="table212">
															<tr>
																<td width="13%" height="35"></td>
																<td height="35" colspan="2" class="top_hui_text">
																</td>
															</tr>
															<tr>
																<td width="13%" height="38" class="top_hui_text">
																	<span class="login_txt">管理员： </span>
																</td>
																<td height="38" colspan="2" class="top_hui_text">
																	<input name="admin.username" class="editbox4" value=""
																		size="20" id="username"/>
																</td>
															</tr>
															<tr>
																<td width="13%" height="35" class="top_hui_text">
																	<span class="login_txt"> 密 码：</span>
																</td>
																<td height="35" colspan="2" class="top_hui_text">
																	<input class="editbox4" type="password" size="20"
																		name="admin.password" id="password"/>
																</td>
															</tr>
															<tr id='resultMsg'>
																<td width="13%" height="35" class="top_hui_text">
																</td>
																<td height="35" colspan="2" class="top_hui_text">
																	<div id="resultMsgContent" class="login_txt"></div>
																</td>
															</tr>
															<tr>
																<td height="35"></td>
																<td width="20%" height="35">
																	<input name="Submit" type="button" class="button"
																		id="Submit" value="登 陆" onclick="login()">
																</td>
																<td width="70%" class="top_hui_text">
																	<input name="cs" type="button" class="button" id="cs"
																		value="重 置" onClick="reset()">
																</td>
															</tr>
														</table>
													</form>
												</td>
											</tr>
											<tr>
												<td width="433" height="164" align="right" valign="bottom"></td>
												<td width="57" align="right" valign="bottom"></td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="20">
				<table width="100%" border="0" cellspacing="0" cellpadding="0"
					class="login-buttom-bg">
					<tr>
						<td align="center">
							<span class="login-buttom-txt">Copyright &copy; 2008-2011 
							<a href="http://www.lengreen.org" >www.lengreen.org</a></span>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>